home *** CD-ROM | disk | FTP | other *** search
/ Apple Reference & Present…ry 5: (Reseller Edition) / Apple Reference & Presentations Library 5.0 (Reseller Edition).iso / 6-Developer Demos / Developer Demos-Gen. / America Online Demo / Online Files / Online CCL / Online CCL.rsrc / AOcl_500_Telenet next >
Encoding:
Text File  |  1989-09-25  |  8.5 KB  |  319 lines

  1. ! -----------------------------------------------------
  2. !   TELENET.ALCL
  3. !   By: David Steinberg
  4. !   Phone = 893-2605  @1200      893-2712  @2400
  5. !   Phone = 1-800-546-1000
  6. !
  7. !   Date:June 20, 1989
  8. !   Rev: 5.00
  9. !Changed 6/21/89 by DMC: Assume "CONNECT" means 1200 baud.
  10. !Changed 7/27/89 by DMC To give new busy message when line is busy
  11. !Changed 9/13/89 by DMC to set modem to extended command set
  12. !Changed 9/19/89 by DMC to show error codes
  13. !----------------------------------------------------------------------
  14. !
  15. ! Connect Sequence:
  16. !
  17. -LABEL 0
  18. Revsion 5
  19. DsplyMsg Initializing modem.
  20. CanBtn 19               { if cancel button - just exit }
  21. SetTries 0
  22. ChrDelay 2
  23. SerReset ~BAUD 0 8 1
  24. HSReset 0 0 17 19
  25. DsplyPic 1
  26. !
  27. !----------------------------------------------------------------------
  28. !
  29. -LABEL 1                { wake up the modem }
  30. Flush
  31. !                         
  32. MatchStr 1 2 +++        { In case we match dont wait for the full time}
  33. MatchStr 2 2 OK         
  34. MatchStr 3 2 >          { Special case for Avatex 1200 modems}
  35.  
  36. Xmit +++                { Get the modems attention}
  37. Wait 200                { Pause for 2 seconds, minimum gap required}
  38. !
  39. -Label 2
  40. MatchStr 1 3 OK
  41. MatchStr 2 33 NO        { Cant hangup}
  42. MatchStr 3 33 ERROR     { Command error}
  43. MatchStr 4 3 >          { Special case for Avatex 1200 modems}
  44. !
  45. Pause 40                { Allow modem to settle between commands.}
  46. Xmit ATZ\13
  47. !                       { jump to label #3 if we see 'OK' go by }
  48. Wait 200                { wait for 'OK' from modem - fall thru if timeout }
  49. Jump 33                 { Exit stage left...time out error on modem.}
  50. !
  51. !----------------------------------------------------------------------
  52. !
  53. -LABEL 3                { just saw 'OK'-Set modem to x1 }
  54. !
  55. MatchStr 1 4 OK
  56. MatchStr 2 4 ERROR        {We don't care what we get for this one}
  57. !
  58. Pause 40                { Allow modem to settle between commands.}
  59. Xmit ATE1Q0X1\13
  60.  
  61. -LABEL 4                { Now try to dial }
  62.  
  63. DsplyMsg Dialing ~FONE
  64. !
  65. !Changed 6/21/89 by DMC: Assume "CONNECT" means 1200 baud.
  66. MatchStr 1 6 CONNECT\13
  67. MatchStr 2 5 CONNECT 300
  68. MatchStr 3 6 CONNECT 1200
  69. MatchStr 4 12 CONNECT 2400    {If there using an MNP modem at dial at say 9600 and connect}
  70. MatchStr 5 12 CONNECT 4800    {at 1200/300 then there screwed for now.}
  71. MatchStr 6 12 CONNECT 9600
  72. MatchStr 7 33 NO DIAL
  73. MatchStr 8 27 NO ANSWER
  74. MatchStr 9 33 VOICE
  75. MatchStr 10 33 CARRIER
  76. MatchStr 11 26 BUSY
  77. MatchStr 12 33 ERROR
  78. !
  79. SetTries 0
  80. CanBtn 18               { if cancel button hit, hangUp then exit }
  81. Pause 30
  82. Xmit AT~MSTR D~TONE~FONE\13
  83. !                       { jump to label #13 if match }
  84. Wait 2400               { wait 30 seconds for CONNECT msg from modem }
  85. !
  86. !
  87. MatchStr 1 7 2400       {We'll couldn't match, But maybe were using an MNP modem.}
  88. MatchStr 2 8 4800       {We could encounter some confusion with number dialed here.} 
  89. MatchStr 3 9 9600       {Dont check for 300,1200 due to this confusion.}
  90. !                       {Plus MNP modems may talk at a higher baud rate then there connect at.}
  91. !
  92. Wait 30
  93. Jump 27                 { else hang up phone & exit  }
  94. !
  95. !----------------------------------------------------------------------
  96. !
  97. -Label 5
  98. SerReset 300 0 8 1
  99. Pause 20
  100. FLUSH
  101. Jump 12
  102. !
  103. !
  104. -Label 6
  105. SerReset 1200 0 8 1
  106. Pause 20
  107. FLUSH
  108. Jump 12
  109. !
  110. !
  111. -Label 7
  112. SerReset 2400 0 8 1
  113. Pause 20
  114. FLUSH
  115. Jump 12
  116. !
  117. -Label 8
  118. SerReset 4800 0 8 1
  119. Pause 20
  120. FLUSH
  121. Jump 12
  122. !
  123. -Label 9
  124. SerReset 9600 0 8 1
  125. Pause 20
  126. FLUSH
  127. Jump 12
  128. !
  129. !
  130. !
  131. !----------------------------------------------------------------------
  132. !
  133. -LABEL 12               { Modem just sent 'CONNECT' message }
  134. DsplyPic 2
  135. !        
  136. -LABEL 13               {  Establishing Connection }
  137. Pause 30
  138. ChrDelay 20      
  139. Cond \13D\13            { 300 baud }
  140. Cond \13D\13            {1200 baud }
  141. Cond @D\13              {2400 baud }
  142. Cond @D\13              {4800 baud }
  143. Cond @D\13              {9600 baud }
  144. !
  145. !
  146. MatchStr 1 15 =        
  147. MatchStr 2 33 ?         {Command error}
  148. MatchStr 3 32 LOCAL     {Net Busy}
  149. MatchStr 4 16 @         {Skip the D1, missed the = sign}
  150. !
  151. Xmit ~SYNC
  152. Wait 600                {Try to sync up to four times}
  153. IncTries
  154. IfTries 4 32
  155. Jump 13
  156. !
  157. !----------------------------------------------------------------------
  158. !
  159. -LABEL 15               { = for term ID}
  160. !                         Sending Terminal Identifier
  161. !
  162. ChrDelay 2
  163. MatchStr 1 16 @
  164. MatchStr 2 33 ?         {Command error}
  165. MatchStr 3 20 =         {800 number dialing.}
  166. Pause 20
  167. Xmit D1\13
  168. !
  169. Wait 600
  170. Jump 32
  171. !
  172. !----------------------------------------------------------------------
  173. !
  174. -LABEL 16                { @ for Host num}
  175. !                         Sending MacLink node number.
  176. !
  177. MatchStr 1 17 CONNECTED
  178. MatchStr 2 33 ?          {Command error}
  179. MatchStr 3 32 NOT RESP   {Applelink down}
  180. MatchStr 4 32 AVAIL      {Applelink down}
  181. MatchStr 5 32 REJECT     {Applelink down}
  182. MatchStr 6 33 LOCAL      {Net busy}
  183. MatchStr 7 33 ERROR      {Command error}
  184. MatchStr 8 33 DISCONNECT {Invalid node}
  185. MatchStr 9 33 NOT PERMIT {Access via wats line.}
  186. !
  187. Pause 20
  188. Xmit C ~TLN1\13
  189. Wait 900
  190. Jump 32
  191. !
  192. !----------------------------------------------------------------------
  193. !
  194. -LABEL 17               { System Ready ... All is well }
  195. Exit 0
  196. !
  197. !----------------------------------------------------------------------
  198. !
  199. -Label 18               { User aborted sequence }
  200. Hangup
  201. Exit -111
  202. !
  203. -Label 19               { User aborted sequence...dont need to hang up thou}
  204. Exit -111
  205. !----------------------------------------------------------------------
  206. !
  207. -Label 20              {800 number sequence.}
  208. Pause 30
  209. !
  210. MatchStr 1 16 @
  211. MatchStr 2 33 ?         {Command error}
  212. MatchStr 3 20 =         {800 number dialing.}
  213. !
  214. Xmit ~TLN2\13
  215. Wait 600
  216. Jump 32
  217. !
  218. !
  219. !----------------------------------------------------------------------
  220. !
  221. -Label 26              {Busy phone}
  222. Talert All phone lines are currently busy. \13Please wait a few minutes and try again.\13
  223. Jump 36
  224. !
  225. !----------------------------------------------------------------------
  226. !
  227. !
  228. !
  229. -Label 27              {No Answer}
  230. Talert There is no answer from the access  company (Error # 3).\13Verify the access number and try again.\13
  231. Jump 36
  232. !
  233. !----------------------------------------------------------------------
  234. !
  235. -Label 28              {Noisy line}
  236. Talert There is noise on your phone line (Error # 16).\13Please try again.\13
  237. Jump 36
  238. !
  239. !----------------------------------------------------------------------
  240. !
  241. -Label 29              {acct bad}
  242. Talert Unable to verify account information (Error # 22).\13\13
  243. Jump 36
  244. !
  245. !----------------------------------------------------------------------
  246. !
  247. -Label 30              {disk problem}
  248. Talert There was an error in reading your ~APPL disk (Error # 0).Please try again.\13
  249. Jump 36
  250. !
  251. !----------------------------------------------------------------------
  252. -Label 31              {acct aleady on}
  253. Talert Please wait a few minutes and try again (Error # 23).\13\13
  254. Jump 36
  255. !
  256. !----------------------------------------------------------------------
  257. !
  258. -Label 32              {not_avail}
  259. Talert ~APPL is not available at the moment (Error # 20).\13Please wait a few minutes and try again.\13\13
  260. Jump 36
  261. !
  262. !----------------------------------------------------------------------
  263. !
  264. -Label 33              {generic}
  265. Talert Unable to initialize modem (Error # 1). Please take the following steps:\13\13 1) Turn your modem off, then back on.\13 2) Verify the access number.\13 3) Make sure that your modem and phone line are connected  correctly.\13 4) Try again.
  266. Jump 36
  267. !
  268. !----------------------------------------------------------------------
  269. !
  270. -Label 34               {db_error}
  271. Talert There is a bad ~APPL file on your disk (Error # 0).\13\13
  272. Jump 36
  273. !
  274. !----------------------------------------------------------------------
  275. !
  276. -Label 35
  277. Exit -1
  278. !
  279. -Label 36
  280. Alert 35 \13If the problem persists, call ~APPL customer service at ~ACUS.
  281. Exit -1
  282. !----------------------------------------------------------------------
  283. !
  284. *-Label 0                {Hangup Sequence}
  285. *CanBtn 2
  286. !
  287. *Flush
  288. !
  289. *MatchStr 1 1 OK         { Dont look for an echo first time, maybe a}
  290. *MatchStr 2 1 NO         { false echo.  Any type of match is good}
  291. *MatchStr 3 1 >          { Special case for Avatex 1200 modems}
  292. !
  293. *Xmit +++                {Try and get the modems attention}
  294. *Wait 210
  295. !
  296. *MatchStr 1 1 OK
  297. *MatchStr 2 2 CARRIER {Any type of match is good}
  298. *MatchStr 3 1 +++
  299. *MatchStr 4 1 >          { Special case for Avatex 1200 modems}
  300. !
  301. *Xmit +++                {Double our odds}
  302. *Wait 210
  303. !
  304. *-Label 1
  305. *MatchStr 1 2 ERROR
  306. *MatchStr 2 2 OK
  307. *MatchStr 3 2 CARRIER
  308. *MatchStr 4 2 >          { Special case for Avatex 1200 modems}
  309. !
  310. *Pause 40
  311. *Xmit AT H\13
  312. *Wait 300
  313. !
  314. *-Label 2
  315. *Exit 0
  316. !
  317. ###
  318.